%module OgreOverlayElement

%{
#include "OGRE/OgreOverlayElement.h"
	%}

%import "OgrePrerequisites.i"
%import "OgreString.i"
 //#include "OgreRenderable.h"
 //#include "OgreUTFString.h"
 //#include "OgreStringInterface.h"
 //#include "OgreOverlayElementCommands.h"

%import "OgreColourValue.i"
 //#include "OgreRectangle.h"

%import "OgreMaterial.i"

namespace Ogre {

//#if OGRE_UNICODE_SUPPORT
//	typedef UTFString DisplayString;
//#	define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) it.getCharacter()
//#else
	typedef String DisplayString;
//#	define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) *it
//#endif

    enum GuiMetricsMode
    {
        /// 'left', 'top', 'height' and 'width' are parametrics from 0.0 to 1.0
        GMM_RELATIVE,
        /// Positions & sizes are in absolute pixels
        GMM_PIXELS,
        /// Positions & sizes are in virtual pixels
        GMM_RELATIVE_ASPECT_ADJUSTED
    };

    enum GuiHorizontalAlignment
    {
        GHA_LEFT,
        GHA_CENTER,
        GHA_RIGHT
    };

    enum GuiVerticalAlignment
    {
        GVA_TOP,
        GVA_CENTER,
        GVA_BOTTOM
    };

	%nodefaultctor OverlayElement;
    class OverlayElement //: public StringInterface, public Renderable , public OverlayAlloc
    {
    public:
        /// Constructor: do not call direct, use OverlayManager::createElement
//        OverlayElement(const String& name);
        virtual ~OverlayElement();

//        virtual void initialise(void) = 0;

        const String& getName(void) const;

        virtual void show(void);

        virtual void hide(void);

        bool isVisible(void) const;

        bool isEnabled() const;
        virtual void setEnabled(bool b);

        void setDimensions(Real width, Real height);

        void setPosition(Real left, Real top);

        void setWidth(Real width);

        Real getWidth(void) const;

        void setHeight(Real height);

        Real getHeight(void) const;

        void setLeft(Real left);

        Real getLeft(void) const;

        void setTop(Real Top);

        Real getTop(void) const;

        Real _getLeft(void) const { return mLeft; }

        Real _getTop(void) const { return mTop; }

        Real _getWidth(void) const { return mWidth; }

        Real _getHeight(void) const { return mHeight; }

        void _setLeft(Real left);

        void _setTop(Real top);

        void _setWidth(Real width);

        void _setHeight(Real height);

        void _setPosition(Real left, Real top);

        void _setDimensions(Real width, Real height);

        virtual const String& getMaterialName(void) const;

        virtual void setMaterialName(const String& matName);

        // --- Renderable Overrides ---

        const MaterialPtr& getMaterial(void) const;

//        void getWorldTransforms(Matrix4* xform) const;

//        virtual void _positionsOutOfDate(void);

//        virtual void _update(void);

//        virtual void _updateFromParent(void);

        virtual Real _getDerivedLeft(void);

        virtual Real _getDerivedTop(void);

	virtual Real _getRelativeWidth(void);

	virtual Real _getRelativeHeight(void);

//        virtual void _getClippingRegion(Rectangle &clippingRegion);

        virtual const String& getTypeName(void) const;

	virtual void setCaption(const DisplayString& text);

//        virtual const DisplayString& getCaption(void) const;

        virtual void setColour(const ColourValue& col);

        virtual const ColourValue& getColour(void) const;

//        virtual void setMetricsMode(GuiMetricsMode gmm);

//        virtual GuiMetricsMode getMetricsMode(void) const;

//        virtual void setHorizontalAlignment(GuiHorizontalAlignment gha);

//        virtual GuiHorizontalAlignment getHorizontalAlignment(void) const;

//        virtual void setVerticalAlignment(GuiVerticalAlignment gva);

//        virtual GuiVerticalAlignment getVerticalAlignment(void) const;

        virtual bool contains(Real x, Real y) const;

        virtual OverlayElement* findElementAt(Real x, Real y);		// relative to parent

        inline virtual bool isContainer() const;

        inline virtual bool isKeyEnabled() const;

        inline virtual bool isCloneable() const;

        inline virtual void setCloneable(bool c);

//        OverlayContainer* getParent() ;

//        void _setParent(OverlayContainer* parent) { mParent = parent; }

        inline ushort getZOrder() const;

//        Real getSquaredViewDepth(const Camera* cam) const ;

//        const LightList& getLights(void) const;

        virtual void copyFromTemplate(OverlayElement* templateOverlay);
        virtual OverlayElement* clone(const String& instanceName);

        const OverlayElement* getSourceTemplate () const;
    };
}
